CREATE TABLE [dbo].[TRMENU_GRUP]
(
[CO_SIST] [dbo].[TD_VC_008] NOT NULL,
[CO_MODU] [dbo].[TD_VC_008] NOT NULL,
[CO_MENU] [dbo].[TD_VC_020] NOT NULL,
[CO_GRUP] [dbo].[TD_VC_008] NOT NULL,
[ST_ADIC] [dbo].[TD_VC_001_SINO] NULL,
[ST_MODI] [dbo].[TD_VC_001_SINO] NULL,
[ST_ANUL] [dbo].[TD_VC_001_SINO] NULL,
[ST_REPO] [dbo].[TD_VC_001_SINO] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TRMENU_GR__CO_US__76619304] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TRMENU_GR__FE_US__7755B73D] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TRMENU_GR__CO_US__7849DB76] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TRMENU_GR__FE_US__793DFFAF] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TRMENU_GRUP] WITH NOCHECK ADD CONSTRAINT [CK__TRMENU_GR__ST_AD__72910220] CHECK NOT FOR REPLICATION (([ST_ADIC]='N' OR [ST_ADIC]='S'))
GO
ALTER TABLE [dbo].[TRMENU_GRUP] WITH NOCHECK ADD CONSTRAINT [CK__TRMENU_GR__ST_AN__74794A92] CHECK NOT FOR REPLICATION (([ST_ANUL]='N' OR [ST_ANUL]='S'))
GO
ALTER TABLE [dbo].[TRMENU_GRUP] WITH NOCHECK ADD CONSTRAINT [CK__TRMENU_GR__ST_MO__73852659] CHECK NOT FOR REPLICATION (([ST_MODI]='N' OR [ST_MODI]='S'))
GO
ALTER TABLE [dbo].[TRMENU_GRUP] WITH NOCHECK ADD CONSTRAINT [CK__TRMENU_GR__ST_RE__756D6ECB] CHECK NOT FOR REPLICATION (([ST_REPO]='N' OR [ST_REPO]='S'))
GO
ALTER TABLE [dbo].[TRMENU_GRUP] ADD CONSTRAINT [PK__TRMENU_G__13A0FE56284DF453] PRIMARY KEY CLUSTERED  ([CO_SIST], [CO_MODU], [CO_MENU], [CO_GRUP]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TRMENU_GRUP] ADD CONSTRAINT [FK__TRMENU_GRUP__469D7149] FOREIGN KEY ([CO_SIST], [CO_GRUP]) REFERENCES [dbo].[TRSIST_GRUP] ([CO_SIST], [CO_GRUP])
GO
ALTER TABLE [dbo].[TRMENU_GRUP] ADD CONSTRAINT [FK__TRMENU_GRUP__47919582] FOREIGN KEY ([CO_SIST], [CO_MODU], [CO_MENU]) REFERENCES [dbo].[TMMENU] ([CO_SIST], [CO_MODU], [CO_MENU])
GO
GRANT SELECT ON  [dbo].[TRMENU_GRUP] TO [public]
GRANT INSERT ON  [dbo].[TRMENU_GRUP] TO [public]
GRANT DELETE ON  [dbo].[TRMENU_GRUP] TO [public]
GRANT UPDATE ON  [dbo].[TRMENU_GRUP] TO [public]
GO
